package ru.sh;

import ru.sh.hero.Soldier;
import ru.sh.screen.SHGameScreen;
import ru.sh.screen.SHMenuScreen;
import framework.Game;
import framework.GameCamera;
import framework.GameConfig;
import framework.GameScreen.State;

public class SHGame extends Game {
	
	public SHGame() {
		super();
	}	
	
	private SHGameScreen gameScreen;
	private SHMenuScreen menuScreen;
	
	@Override
	protected void initStartScreen() {
		currentScreen = menuScreen;
	}

	@Override
	protected void initScreens() {
		gameScreen = new SHGameScreen(this);
		menuScreen = new SHMenuScreen(this);
	}
	
	public void setGameScreen() {
		currentScreen = gameScreen;
	}
	
	public void setMenuScreen() {
		currentScreen = menuScreen;
	}
	
	public void restart() {
		gameScreen = new SHGameScreen(this);
		currentScreen = gameScreen;
		GameCamera.setPosition(GameConfig.BASE_WIDTH / 2 - GameCamera.CAMERA_WIDTH / 2,
				GameConfig.BASE_HEIGHT / 2 - GameCamera.CAMERA_HEIGHT / 2);
	}

	@Override
	protected void onPause() {
		currentScreen.setState(State.PAUSE);
	}

	@Override
	protected void onResume() {
		//TODO
	}
	
	public Soldier getHero() {
		return gameScreen.getHero();
	}

	@Override
	protected void onDestroy() {
		//TODO
	}

}
